{% extends 'layout.html' %}
{% block main%}
<!--巨屏幕-->
<div class="container-fluid">
    <div class="jumbotron">
        <h1>欢迎访问小白的博客</h1>
        <p>Hello,{%if userInfo.username%} {{userInfo.username}} {%else%} 游客请点击右上角注册或登录 {%endif%}</p>
        {% if userInfo.isAdmin %}
        <p>你是管理员</p>
        <p><a href="/admin">点击进入后台管理</a></p>
        {% endif %}
    </div>
</div>
<div class="container-fluid">
    <!-- <div class="row">
         <video class="col-lg-6 center-block" controls="controls" autoplay>
             <source src="movie.ogg" type="video/ogg"/>
             <source src="/public/video/1.mp4" type="video/mp4" />
             你的浏览器不支持这个播放,请安装高级浏览器!
         </video>
     </div>-->
    <div class="row">
        {% for content in contents %}
        <div class="col-sm-6 col-md-4">
            <div class="thumbnail">
                <div class="caption">
                    <h3>{{content.title}}</h3>
                    <h5>{{content.description}}</h5>
                    <p style="height: 100px;overflow:hidden;text-overflow: ellipsis">{{content.content}}</p>
                    <p>{{content.username}} {{content.date}}</p>
                    <p><a href="/conteninfo?contentid={{content.id}}" class="btn">查看详情</a> <a href="#" class="btn" role="button">收藏</a></p>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock%}
